/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.service.dishes;
import com.alibaba.fastjson.JSONObject;
import com.qinyeit.serviceapp.entity.enums.State;
import com.qinyetech.springstage.core.entity.search.Searchable;
import com.qinyetech.springstage.core.service.IBaseService;
import com.qinyeit.serviceapp.entity.ChangePrice;
import org.springframework.data.domain.Page;

import java.util.Map;

/** 
 * ClassName: ChangePriceService <br/> 
 * Function: 菜品变价单业务功能 <br/> 
 * date: 2018-11-27 15:11:36 <br/> 
 * 
 * @author liuwenjin
 * @version 1.0
 * @since JDK 1.8
 */
public interface ChangePriceService extends IBaseService<ChangePrice, Long>{

    /**
     * 保存变价
     * @param data
     *      changePrice:{
     *          menuId:菜谱id
     *          reason：变价原因
     *          effectiveTime：生效日期 例如：2018-11-28
     *
     *      }
     *      dishes:[{
     *          dishesId:菜品id
     *          specId:规格id
     *          specName:规格名称
     *          oldPrice:原价
     *          price：便后价格
     *          oldVipPrice：会员价
     *          vipPrice：变后会员价
     *      }]
     *      branchs:[1,2] -- 生效门店
     *
     * @param merchantGroupId
     * @param operator
     */
    void saveData(JSONObject data,Long merchantGroupId,String operator);

    /**
     * 编辑变价
     * @param data
     */
    void updateData(JSONObject data,String operator);

    /**
     * 变价分页查询
     * @param name 菜品名称 或 变价原因
     * @param state 状态 禁用启用
     * @param districtId 区域id
     * @param merchantGroupId
     * @return
     */
    Page<Map<String,Object>> findDataByPage(Searchable searchable,String name, String state, Long districtId, Long merchantGroupId);

}